/*import React from "react";
import {Row,Col,Carousel } from "antd";
import NewsList from "../newslist";
import HeadList from "../header";
import "../../../../static/css/mobile/hot.css";
export default class YL extends React.Component {
	constructor() {
		super();
		this.state = {
			ylNews: []
		}
	}
	componentDidMount() {
		var result = fetch("http://www.wwtliu.com/sxtstu/news/juhenews.php?type=yule&count=5", {
				method: "get"
			})
			.then(res => {
				return res.json();
			})
			.then(json => {
				this.setState({
					ylNews: json
				})
			})
	}
	render() {

		var {ylNews} = this.state;
		return(
			<div>
				
				<div className="carouse">
					<Carousel autoplay>
				    {
				    	ylNews.map((item,index) => {
							return <div key={index}><img src={item.thumbnail_pic_s} alt="图片"/></div>
						})
				    }
				 </Carousel>
				 <NewsList />
				</div>
				
			</div>
		)
	}
}*/

import React from "react";
import NewsModal from "../newsModal/modal";
import {Row,Col,Carousel } from "antd";
import "../../../../static/css/mobile/hot.css";

export default class YL extends React.Component{
	constructor() {
		super();
		this.state = {
			ylNews: []
		}
	}
	componentDidMount() {
		var result = fetch("http://www.wwtliu.com/sxtstu/news/juhenews.php?type=yule&count=5", {
				method: "get"
			})
			.then(res => {
				return res.json();
			})
			.then(json => {
				this.setState({
					ylNews: json
				})
			})
	}
	render(){
		var bdItURL="http://www.wwtliu.com/sxtstu/news/juhenews.php?type=yule&count=";
		var {ylNews} =this.state;
		return(
			<div>
				<div className="carouse">
						<Carousel autoplay>
					    {
					    	ylNews.map((item,index) => {
								return <div key={index}><img src={item.thumbnail_pic_s} alt="图片"/></div>
							})
					    }
					 </Carousel>
				</div>
				 <NewsModal url={bdItURL} />
			</div>

		)
	}
}